package com.seal.tsms.other.entity;

import com.seal.tsms.base.entity.BaseEntity;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by seal on 2016/3/20.
 */
@Entity
@Table(name="other_token")
public class Token extends BaseEntity{
    private String nickName;
    private String telNo;
    private Set<Subject> sendSubjects=new HashSet<>();//我发布过的话题
    private Set<Reply> replies=new HashSet<>();//我回复过的话题
    private Set<Vote> votes=new HashSet<>();//我支持过的

    @Column(name = "token_nick_name")
    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    @Column(name = "token_telno")
    public String getTelNo() {
        return telNo;
    }

    public void setTelNo(String telNo) {
        this.telNo = telNo;
    }

    @OneToMany(cascade = CascadeType.ALL,mappedBy = "token")
    public Set<Subject> getSendSubjects() {
        return sendSubjects;
    }

    public void setSendSubjects(Set<Subject> sendSubjects) {
        this.sendSubjects = sendSubjects;
    }

    @OneToMany(cascade = CascadeType.ALL,mappedBy = "token")
    public Set<Reply> getReplies() {
        return replies;
    }

    public void setReplies(Set<Reply> replies) {
        this.replies = replies;
    }

    @OneToMany(cascade = CascadeType.ALL,mappedBy = "token")
    public Set<Vote> getVotes() {
        return votes;
    }

    public void setVotes(Set<Vote> votes) {
        this.votes = votes;
    }
}
